
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>变换、过渡、动画 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Landen">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-image-captions/image-captions.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="sass和rem.html" />
    
    
    <link rel="prev" href="浮动和定位.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../01html/html简介.html">
            
                <a href="../01html/html简介.html">
            
                    
                    HTML
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../01html/01html.html">
            
                <a href="../01html/01html.html">
            
                    
                    a链接、图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../01html/02html.html">
            
                <a href="../01html/02html.html">
            
                    
                    列表、表格、表单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../01html/h5新增.html">
            
                <a href="../01html/h5新增.html">
            
                    
                    h5新增
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="css简介.html">
            
                <a href="css简介.html">
            
                    
                    CSS
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="居中、省略、清浮.html">
            
                <a href="居中、省略、清浮.html">
            
                    
                    居中、省略、清浮
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="浮动和定位.html">
            
                <a href="浮动和定位.html">
            
                    
                    浮动和定位
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.3" data-path="变换、过渡、动画.html">
            
                <a href="变换、过渡、动画.html">
            
                    
                    变换、过渡、动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="sass和rem.html">
            
                <a href="sass和rem.html">
            
                    
                    sass和rem
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="flex、media、栅格化.html">
            
                <a href="flex、media、栅格化.html">
            
                    
                    flex、media、栅格化
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../03js/js简介.html">
            
                <a href="../03js/js简介.html">
            
                    
                    JavaScript
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../03js/数据类型.html">
            
                <a href="../03js/数据类型.html">
            
                    
                    数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../03js/字符串.html">
            
                <a href="../03js/字符串.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../03js/数组.html">
            
                <a href="../03js/数组.html">
            
                    
                    数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../03js/回流和重绘.html">
            
                <a href="../03js/回流和重绘.html">
            
                    
                    回流和重绘
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../03js/浏览器的渲染过程.html">
            
                <a href="../03js/浏览器的渲染过程.html">
            
                    
                    浏览器的渲染过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../03js/十大排序算法.html">
            
                <a href="../03js/十大排序算法.html">
            
                    
                    十大排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../03js/对象的构建.html">
            
                <a href="../03js/对象的构建.html">
            
                    
                    对象的构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../03js/this.html">
            
                <a href="../03js/this.html">
            
                    
                    this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../03js/bind&call&apply.html">
            
                <a href="../03js/bind&call&apply.html">
            
                    
                    bind&call&apply
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../03js/函数.html">
            
                <a href="../03js/函数.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../03js/变量提升.html">
            
                <a href="../03js/变量提升.html">
            
                    
                    变量提升
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="../03js/作用域.html">
            
                <a href="../03js/作用域.html">
            
                    
                    作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="../03js/对象.html">
            
                <a href="../03js/对象.html">
            
                    
                    对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.14" data-path="../03js/存储.html">
            
                <a href="../03js/存储.html">
            
                    
                    存储
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.15" data-path="../03js/事件.html">
            
                <a href="../03js/事件.html">
            
                    
                    事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.16" data-path="../03js/图片预览.html">
            
                <a href="../03js/图片预览.html">
            
                    
                    图片预览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.17" data-path="../03js/防抖节流.html">
            
                <a href="../03js/防抖节流.html">
            
                    
                    防抖节流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.18" data-path="../03js/同步异步.html">
            
                <a href="../03js/同步异步.html">
            
                    
                    同步异步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.19" data-path="../03js/babel入门.html">
            
                <a href="../03js/babel入门.html">
            
                    
                    babel入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.20" data-path="../03js/nvm.html">
            
                <a href="../03js/nvm.html">
            
                    
                    nvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.21" data-path="../03js/ES6.html">
            
                <a href="../03js/ES6.html">
            
                    
                    ES6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.22" data-path="../03js/ES6-ES11.html">
            
                <a href="../03js/ES6-ES11.html">
            
                    
                    ES6-ES11
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >变换、过渡、动画</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x53D8;&#x6362;">&#x53D8;&#x6362;</h2>
<ul>
<li>transform &#x53D8;&#x5F62; &#x662F;&#x4E0D;&#x4F1A;&#x6539;&#x53D8;&#x5143;&#x7D20;&#x539F;&#x6709;&#x7684;&#x5927;&#x5C0F;<pre><code>  translate &#x5E73;&#x79FB;
  rotate &#x65CB;&#x8F6C;
  scale &#x7F29;&#x653E;
  skew &#x659C;&#x53D8;
</code></pre><h2 id="&#x8FC7;&#x6E21;">&#x8FC7;&#x6E21;</h2>
<pre><code class="lang-css">  &lt;style type=&quot;text/css&quot;&gt;
      .box {
          width: 800px;
          height: 800px;
          background-color: skyblue;
          overflow: hidden;
      }
      .son {
          width: 200px;
          height: 200px;
          background-color: pink;
          /* &#x5F53;&#x503C;&#x662F;&#x767E;&#x5206;&#x6BD4;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x57FA;&#x4E8E;&#x81EA;&#x8EAB;&#x5143;&#x7D20; */
          /* transform: translateX(-50%); */
          /* transform: rotate(45deg); */
          /* &#x8BBE;&#x7F6E;&#x53D8;&#x6362;&#x57FA;&#x51C6;&#x70B9; */
          /* transform-origin: left top; */
          /* transform: scale(1.5); */
          /* transform: skew(45deg); */
          transition-property: background-color;
          transition-duration: 2s;
      }
      .son:hover {
          background-color: red;
          margin-top: 10px;
          width: 400px;
      }
  &lt;/style&gt;
  &lt;div class=&quot;box&quot;&gt;
      &lt;div class=&quot;son&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
</code></pre>
<h2 id="&#x52A8;&#x753B;">&#x52A8;&#x753B;</h2>
<pre><code class="lang-css">  transition &#x8FC7;&#x6E21;&#x52A8;&#x753B;
  &lt;style type=&quot;text/css&quot;&gt;
      .box {
          width: 500px;
          height: 500px;
          background-color: darkblue;
      }
      .son {
          width: 100px;
          height: 100px;
          background-color: pink;
          /* transition-property: all;
          transition-duration: 2s; */
          animation-name: run;
          animation-duration: 2s;
          animation-delay: .5s;
          animation-timing-function: ease;
          animation-fill-mode: forwards;
          animation-iteration-count: 2;
          /* animation-direction: alternate-reverse; */
          /* forwards &#x505C;&#x5728;&#x7ED3;&#x675F;&#x4F4D;&#x7F6E;
              backwards &#x505C;&#x5728;&#x5F00;&#x59CB;&#x4F4D;&#x7F6E;
              both &#x52A8;&#x753B;&#x7ED3;&#x675F;&#x5728;&#x54EA;&#x91CC;&#x5C31;&#x505C;&#x5728;&#x54EA;&#x91CC;
           */
      }
      /* .son:hover {
          background-color: #05B700;
          margin-left: 400px;
      } */
      @keyframes run{
          0{
              transform: translate(0,0);
          }
          100%{
              transform: translate(400px);
          }
      }
  &lt;/style&gt;
  &lt;!-- &lt;div class=&quot;box&quot;&gt;
      &lt;div class=&quot;son&quot;&gt;&lt;/div&gt;
  &lt;/div&gt; --&gt;
  &lt;style type=&quot;text/css&quot;&gt;
      .box1 {
          background-color: pink;
      }
  &lt;/style&gt;
  &lt;div class=&quot;box1 animate__animated animate__slideInUp&quot;&gt;
      &#x54C8;&#x54C8;&#x54C8;&#x54C8;&#x54C8;&#x54C8;
  &lt;/div&gt;
</code></pre>
</li>
</ul>
<h2 id="&#x9009;&#x62E9;&#x5668;">&#x9009;&#x62E9;&#x5668;</h2>
<ul>
<li>&#x9009;&#x62E9;&#x5668;<pre><code>  * &#x901A;&#x914D;&#x7B26;
  .class &#x7C7B;&#x9009;&#x62E9;&#x5668;
  #id  id&#x9009;&#x62E9;&#x5668;
  p  &#x5143;&#x7D20;&#x9009;&#x62E9;&#x5668;
  &#x5173;&#x7CFB;&#x9009;&#x62E9;&#x5668;
      &gt; &#x7236;&#x5B50;
      &#x7A7A;&#x683C; &#x5B59;&#x5B50;
      + &#x76F8;&#x90BB;
      ~ &#x5144;&#x5F1F;
</code></pre></li>
<li><p>&#x4F2A;&#x7C7B;&#x3001;&#x4F2A;&#x5143;&#x7D20;</p>
<pre><code>  &#x4F2A;&#x7C7B;
      &#x5047;&#x7684;&#x7C7B;
      :hover &#x9F20;&#x6807;&#x7ECF;&#x8FC7;
      :first-child &#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;
      :first-of-type &#x7B2C;&#x4E00;&#x4E2A;&#x540C;&#x7C7B;&#x578B;&#x5143;&#x7D20;
      :not() &#x62EC;&#x53F7;&#x91CC;&#x9762;&#x7684;&#x662F;&#x6392;&#x9664;&#x5728;&#x5916;&#x7684;
      :nth-child(n) n&#x4EE3;&#x8868;&#x7B2C;&#x51E0;&#x4E2A;

  &#x4F2A;&#x5BF9;&#x8C61;
      ::before
      ::after
      &#x5047;&#x7684;&#x4E00;&#x4E2A;html&#x6807;&#x7B7E;

  &#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;
      [type=&quot;text&quot;]

  &#x6743;&#x91CD;&#x95EE;&#x9898; =&gt; &#x5F53;&#x9009;&#x62E9;&#x5668;&#x5199;&#x5F97;&#x8D8A;&#x8BE6;&#x7EC6;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6743;&#x91CD;&#x8D8A;&#x5927;
</code></pre><h2 id="&#x663E;&#x793A;&#x548C;&#x9690;&#x85CF;">&#x663E;&#x793A;&#x548C;&#x9690;&#x85CF;</h2>
</li>
<li><p>display</p>
<pre><code>  block  inline-block  inline
  &#x5143;&#x7D20;&#x7684;&#x663E;&#x793A;  block
  &#x5143;&#x7D20;&#x7684;&#x9690;&#x85CF;  none
  &#x8BBE;&#x7F6E;&#x4E3A;none&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5143;&#x7D20;&#x9690;&#x85CF;&#xFF0C;&#x4E0D;&#x5360;&#x6709;&#x4F4D;&#x7F6E;
</code></pre></li>
<li><p>visibility  &#x7684;&#x663E;&#x793A;&#x548C;&#x9690;&#x85CF;</p>
<pre><code>  hidden  &#x5143;&#x7D20;&#x9690;&#x85CF;,&#x4F1A;&#x5360;&#x6709;&#x4F4D;&#x7F6E;
  visible  &#x53EF;&#x89C1;&#x7684;
</code></pre></li>
<li><p>overflow</p>
<pre><code>  visible  &#x9ED8;&#x8BA4;&#x503C;  &#x8D85;&#x51FA;&#x90E8;&#x5206;&#x53EF;&#x89C1;
  hidden  &#x9690;&#x85CF;  &#x8D85;&#x51FA;&#x90E8;&#x5206;&#x9690;&#x85CF;
  scroll  &#x6EDA;&#x52A8;&#x6761;  &#x8D85;&#x51FA;&#x90E8;&#x5206;&#x7528;&#x6EDA;&#x52A8;&#x6761;&#x663E;&#x793A;
  auto    &#x6EDA;&#x52A8;&#x6761;  &#x5982;&#x679C;&#x5185;&#x5BB9;&#x4E0D;&#x8D85;&#x7684;&#x8BDD;&#xFF0C;&#x5C31;&#x6CA1;&#x6709;&#x6EDA;&#x52A8;&#x6761;
</code></pre></li>
<li><p>opacity</p>
<pre><code>  0 &#x9690;&#x85CF;
  1 &#x663E;&#x793A;
  &#x5143;&#x7D20;&#x9690;&#x85CF;&#xFF0C;&#x4F1A;&#x5360;&#x4F4D;&#x7F6E;
</code></pre><h2 id="&#x5B57;&#x4F53;&#x5E93;">&#x5B57;&#x4F53;&#x5E93;</h2>
<pre><code>  &#x5F15;&#x5165;&#x4E00;&#x4E9B;&#x5B98;&#x65B9;&#x7684;&#x5B57;&#x4F53;&#x5E93;  &#x56FE;&#x6807;&#x4E5F;&#x662F;&#x5C5E;&#x4E8E;

  1.&#x590D;&#x5236;&#x58F0;&#x660E;&#x5185;&#x5BB9;
  2.&#x590D;&#x5236; &#x5C0F;&#x65B9;&#x6846;
  3.&#x8BBE;&#x7F6E;font-family:&quot;icomoon&quot;
</code></pre></li>
</ul>
<h2 id="&#x7F51;&#x9875;&#x4F18;&#x5316;&#x4EE3;&#x7801;&#x4F18;&#x5316;-&#x4EE5;&#x66F4;&#x5C11;&#x7684;&#x4EE3;&#x7801;&#x5B9E;&#x73B0;&#x66F4;&#x591A;&#x7684;&#x529F;&#x80FD;&#x590D;&#x7528;&#x6027;&#x548C;&#x53EF;&#x6269;&#x5C55;&#x6027;">&#x7F51;&#x9875;&#x4F18;&#x5316;=&gt;&#x4EE3;&#x7801;&#x4F18;&#x5316;-&#x4EE5;&#x66F4;&#x5C11;&#x7684;&#x4EE3;&#x7801;&#x5B9E;&#x73B0;&#x66F4;&#x591A;&#x7684;&#x529F;&#x80FD;=&gt;&#x590D;&#x7528;&#x6027;&#x548C;&#x53EF;&#x6269;&#x5C55;&#x6027;</h2>
<pre><code>    css&#x7684;&#x4F18;&#x5316;,&#x7CBE;&#x7075;&#x56FE; sprite

    &#x7CBE;&#x7075;&#x56FE;&#x7684;&#x4F7F;&#x7528;
    1&#x3001;&#x76EE;&#x7684;&#xFF1A;&#x51CF;&#x5C11;http&#x8BF7;&#x6C42;&#xFF0C;&#x52A0;&#x5FEB;&#x7F51;&#x9875;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;
    2&#x3001;&#x539F;&#x7406;&#xFF1A;&#x7CBE;&#x7075;&#x56FE;&#x7684;&#x6280;&#x672F;&#x4E3B;&#x8981;&#x5BF9;&#x4E8E;&#x80CC;&#x666F;&#x56FE;&#x7684;&#x4F7F;&#x7528;
    3&#x3001;&#x4F7F;&#x7528;background-position&#x79FB;&#x52A8;&#x8DDD;&#x79BB;&#x7684;x&#x548C;y&#x5750;&#x6807;
    4&#x3001;&#x901A;&#x5E38;&#x6765;&#x8BF4;&#xFF0C;&#x5141;&#x8BB8;&#x8D1F;&#x503C;
</code></pre>
                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="浮动和定位.html" class="navigation navigation-prev " aria-label="Previous page: 浮动和定位">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="sass和rem.html" class="navigation navigation-next " aria-label="Next page: sass和rem">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"变换、过渡、动画","level":"1.3.3","depth":2,"next":{"title":"sass和rem","level":"1.3.4","depth":2,"path":"md/02css/sass和rem.md","ref":"./md/02css/sass和rem.md","articles":[]},"previous":{"title":"浮动和定位","level":"1.3.2","depth":2,"path":"md/02css/浮动和定位.md","ref":"./md/02css/浮动和定位.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","-sharing","toggle-chapters","image-captions","-anchor-navigation","-anchor-navigation-ex"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Landen","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"_pictures":[]},"gitbook":"3.x.x"},"file":{"path":"md/02css/变换、过渡、动画.md","mtime":"2020-06-08T11:56:44.284Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-08-17T10:41:18.504Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

